#include<iostream>
#include<stdio.h>
using namespace std;

struct ServerInfo
{
  char _ip[32];
  int _port;
};

void Test_W_BIN()
{
      
  ServerInfo info = {"127.0.0.1",80 };
  FILE* fout = fopen("test.bin","w");
  fwrite(&info,sizeof(info),1,fout);
  fclose(fout);
}


void Test_R_BIN()
{
      
  ServerInfo info;
  FILE* fin = fopen("test.bin","r");
  fread(&info,sizeof(info),1,fin);
  fclose(fin);
  printf("%s:%d\n",info._ip,info._port);
}

int main()
{
  Test_R_BIN();

  return 0;
}
